package com.xinchao.job.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xinchao.job.mapper.quartz.NewsMapper;

/**
 * @ClassName NewsService
 * @Description 新闻Service
 * @Author HanQinrui
 * @Date 2018/9/4 14:20
 * @Version 1.0
 **/
@Service("newsService")
public class NewsService {
    @Autowired
    private NewsMapper newsMapper;

    /**
     * 保存新闻信息
     * @param newsList
     */
    public void insertNews(List<String> newsList) {
        Long addTime = System.currentTimeMillis();
        newsMapper.insertNews(newsList, addTime);
    }

    /**
     * 获取新闻信息
     * @param charSize 新闻标题长度
     * @param newsSize 新闻条数
     * @return
     */
    public List<String> getNews(int charSize, int newsSize) {
        return newsMapper.getNews(charSize, newsSize);
    }

}
